package com.polaris.live.dialog

import android.content.Context
import com.lxj.xpopup.core.CenterPopupView
import com.polaris.live.R
import com.polaris.live.databinding.DialogDeleteAcountBinding
import com.polaris.live.common.ext.setOnSingleClickListener

/**
 * 删除账号弹窗
 *
 * @author Created by 长空 on 2023/11/10/006 10:24
 */
class DeleteAccountDialog(
    context: Context,
    private val onConfirmCallback: (() -> Unit)? = null,
) :
    CenterPopupView(context) {
    override fun getImplLayoutId(): Int {
        return R.layout.dialog_delete_acount
    }

    private lateinit var mBinding: DialogDeleteAcountBinding

    override fun onCreate() {
        super.onCreate()
        mBinding = DialogDeleteAcountBinding.bind(popupImplView)
        mBinding.tvConfirm.setOnSingleClickListener {
            onConfirmCallback?.invoke()
            dismiss()
        }
        mBinding.tvCancel.setOnSingleClickListener {
            dismiss()
        }
    }
}